package com.landray.kmss.km.review.webservice;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

public class ITestService_ITestServicePort_Client {

	private static final QName SERVICE_NAME = new QName("http://service.fee.fs.kmss.landray.com/",
			"ITestServiceService");

	private ITestService_ITestServicePort_Client() {
	}

	public static void main(String args[]) throws java.lang.Exception {
		URL wsdlURL = ITestServiceService.WSDL_LOCATION;
		if(args.length > 0 && args[0] != null && !"".equals(args[0])) {
			File wsdlFile = new File(args[0]);
			try {
				if(wsdlFile.exists()) {
					wsdlURL = wsdlFile.toURI().toURL();
				} else {
					wsdlURL = new URL(args[0]);
				}
			} catch(MalformedURLException e) {
				e.printStackTrace();
			}
		}

		ITestServiceService ss = new ITestServiceService(wsdlURL, SERVICE_NAME);
		ITestService port = ss.getITestServicePort();
		
		
		
        KmReviewParamterForm _addReview_arg0 = createForm();
		
		{
			System.out.println("Invoking testWebService...");
			java.lang.String _testWebService_arg0 = "{\"name\":\"zhangsan\", \"age\":29}";
			java.lang.String _testWebService__return = port.testWebService(_testWebService_arg0);
			System.out.println("testWebService.result=" + _testWebService__return);
		}

		System.exit(0);
	}
	
	
	
    public  static KmReviewParamterForm  createForm()   {
    	KmReviewParamterForm  form  =  new  KmReviewParamterForm();

    //  文档模板id
    	form.setFdTemplateId("131eb0cfd7db55e6980e9ce4985a1387");

    //  文档标题
    	form.setDocSubject("物料采购申请单");

    //  流程发起人
    	form.setDocCreator("{\"PersonNo\":  \"00012\"}");

    //  文档关键字
    	form.setFdKeyword("[\"物料\",  \"采购\"]");

    //  流程表单
    	String  formValues  =  "{\"fd_2eddbf023c8292\":\"张三\",  \"fd_2edd2f83f68242\":\"咨询部\",  \"fd_2edd2fa69f6fc6\":\"\",  \"fd_2eddbf09f9bc96\":\"2011-10-26\",  \"fd_2edd2fb18e7f90\":{\"fd_2edd2fb18e7f90.fd_2eddbef4da4688\":[\"555555\",\"777777\"],  \"fd_2edd2fb18e7f90.fd_2edd2fc8001062\":[\"444444\",\"666666\"],  \"fd_2edd2fb18e7f90.fdId\":[\"1332472122898ac618f3e22460cab595\",\"13324721228b50c184d82c44ceca5301\"]}}";
    	form.setFormValues(formValues);

    //  流程参数
    	String  flowParam  =  "{auditNode:\"请审核\",  futureNodeId:\"N7\",  changeNodeHandlers:[\"N7:1183b0b84ee4f581bba001c47a78b2d9;131d019fbac792eab0f0a684c8a8d0ec\"]}";
    	form.setFlowParam(flowParam);

    	return  form;
    }

}
